﻿Imports Microsoft.VisualBasic
Imports DotNetNuke.Modules.Dashboard.Components
Imports DotNetNuke.Data

Namespace Disgrafic.DotNetNuke.DGSchedulerDashboard

	Public Class DelayedTasksController
		Implements IDashboardData

		Public Sub ExportData(ByVal writer As System.Xml.XmlWriter) Implements IDashboardData.ExportData

			Dim ds As DataSet = GetData(5, True, 7)

			If ds IsNot Nothing Then
				ds.DataSetName = "DelayedTasks"
				ds.Tables(0).TableName = "Task"
				ds.WriteXml(writer)
			End If

		End Sub

		Public Shared Function GetData(ByVal delayThresholdMins As Integer, ByVal onlyActiveTasks As Boolean, ByVal maxDays As Integer) As DataSet

			Return DataProvider.Instance().ExecuteDataSet("DGDelayedTasks_DashboardControl", delayThresholdMins, onlyActiveTasks, maxDays)

		End Function

	End Class

End Namespace